﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucMainMenu.ascx.cs" Inherits="WebTeamplate.Admin_UserControl_ucMainMenu" %>
<%@ Import Namespace="BusinessObject" %>
<%@ Import Namespace="Utility" %>
<table class="hdrTabBg" border="0" cellpadding="0" cellspacing="0" width="100%">
    <tbody>
        <tr>
            <td style="width: 50px;" class="small">
                &nbsp;
            </td>
            <td class="small" nowrap="nowrap">
                <table border="0" cellpadding="0" cellspacing="0" align="left">
                    <tbody>
                        <tr>
                            <%-- <td class="tabSeperator">
                                <img src="../App_Themes/Admin/images/spacer.gif" width="2px" height="28px" alt="">
                            </td>--%>
                           <%-- <td class="tabUnSelected" align="left" nowrap="nowrap" style="width: 100px;">
                                <a href="Default.aspx" >Trang chủ</a><img src="../App_Themes/Admin/images/menuDnArrow.gif"
                                        style="padding-left: 5px;" border="0">
                            </td>--%>
                            <%foreach (MenuResult objMenuParent in lstMenu)
                              {
                                  if (objMenuParent.ParentID < 0)
                                  {
                                      if (!objMenuParent.HasChild)
                                      {
                            %>
                            <td class="tabSeperator">
                                <img src="../App_Themes/Admin/images/spacer.gif" width="2px" height="28px" alt="">
                            </td>
                            <td class="tabUnSelected" align="left" nowrap="nowrap" style="width: 100px;">
                                <a href="<%=this.BaseUrl + objMenuParent.Link %>">
                                    <%=objMenuParent.Name%></a><img src="../App_Themes/Admin/images/menuDnArrow.gif"
                                        style="padding-left: 5px;" border="0">
                            </td>
                            <%}
                                      else {%>
                                       <td class="tabSeperator">
                                <img src="../App_Themes/Admin/images/spacer.gif">
                            </td>
                            <td class="tabUnSelected" onmouseover="fnDropDown(this,'<%=objMenuParent.Id %>');" onmouseout="fnHideDrop('<%=objMenuParent.Id %>');"
                                align="left" nowrap="nowrap">
                                <a href="#"><%=objMenuParent.Name%></a><img src="../App_Themes/Admin/images/menuDnArrow.gif" style="padding-left: 5px;"
                                    border="0">
                            </td>
                                      <% }
                                  }
                              }%>
                           
                        </tr>
                    </tbody>
                </table>
            </td>
            <td style="padding-right: 10px;" align="right" nowrap="nowrap">
            </td>
        </tr>
    </tbody>
</table>
<!-- Drop Down Menu in the Main Tab -->
<%foreach (MenuResult objMenu in lstMenu)
  {
      if (objMenu.HasChild)
      {
          lstMenuChild = GetListChild(objMenu);
%>
<div class="drop_mnu" id="<%=objMenu.Id%>" onmouseout="fnHideDrop('<%=objMenu.Id%>')" onmouseover="fnShowDrop('<%=objMenu.Id%>')">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
        <tbody>
            <%
                for (int j = 0; j < lstMenuChild.Count; j++)
                {
                    MenuResult objChild = lstMenuChild[j];                
                    if (j == lstMenuChild.Count - 1)
                    {%>
            <tr>
                <td>
                    <a href="<%=this.BaseUrl + objChild.Link %>"
                        class="drop_down">
                        <%=objChild.Name%></a>
                </td>
            </tr>
        </tbody>
    </table>
</div>
<%}
                    else
                    { 
%>
<tr>
    <td>
        <a href="<%=this.BaseUrl + objChild.Link %>"
            class="drop_down">
            <%=objChild.Name%></a>
    </td>
</tr>
<%
    }
                }

      }
  }
            
%>

<table class="level2Bg" border="0" cellpadding="2" cellspacing="0" width="100%">
                    <tbody>
                        <tr>
                            <td>
                                <table border="0" cellpadding="0" cellspacing="0" align="left">
                                    <tbody>
                                        <tr>
                                            <%foreach (MenuResult objMenu in lstMenuChildLevel2)
                                              { %>
                                                <td class="level2UnSelTab" nowrap="nowrap" align="left">
                                                <a href="<%=this.BaseUrl + objMenu.Link %>"><%=objMenu.Name %></a>
                                            </td>
                                              <%} %>
                                        </tr>                                      
                                      
                                    </tbody>
                                </table>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <% if(!IsAdminDefaultPage()){ %>
                 <table class="small" border="0" cellpadding="0" cellspacing="0" width="100%">
                    <tbody>
                        <tr>
                            <td style="height: 2px;">
                            </td>
                        </tr>
                        <tr>
                            <td style="padding-left: 10px; padding-right: 50px;" class="moduleName" nowrap="nowrap">
                                <%=this.menuParentName %> &gt; <%=this.menuChildName %>
                            </td>
                            <td width="100%" nowrap="nowrap">
                            </td>
                        </tr>
                    </tbody>
                </table>
                <%} else{%>
                    <table class="small" border="0" cellpadding="0" cellspacing="0" width="100%">
                    <tbody>
                        <tr>
                            <td style="height: 2px;">
                            </td>
                        </tr>
                        <tr>
                            <td style="padding-left: 10px; padding-right: 50px;" class="moduleName" nowrap="nowrap">
                               Trang chủ
                            </td>
                            <td width="100%" nowrap="nowrap">
                            </td>
                        </tr>
                    </tbody>
                </table>
                <%} %>